$wixFile = [System.IO.Path]::Combine( (Get-Location), $args[0]) 

$doc = new-object System.Xml.XmlDocument
$doc.Load($wixFile)
$nsmgr = new-object System.Xml.XmlNamespaceManager($doc.get_NameTable())
$nsmgr.AddNamespace("ab","http://schemas.microsoft.com/wix/2006/wi")
$node = $doc.SelectSingleNode("/ab:Wix/ab:Product/ab:Directory",$nsmgr)
$node.get_Attributes().ItemOf("Name").set_Value("SourceDir")
$node.get_Attributes().ItemOf("Id").set_Value("TARGETDIR")
$doc.Save($wixFile)